# -*- coding: utf-8 -*-
__author__ = 'ranzechen'
__time__ = 2019 / 4 / 10
__function__ = ''

import requests
from ProxyPool.settings import TEST_URL,API_HOST,API_PORT

proxy = requests.get('http://%s:%s/random' % (API_HOST,API_PORT)).text

proxies = {
    'http': 'http://' + proxy,
    'https': 'https://' + proxy,
}

print(TEST_URL)
response = requests.get(TEST_URL, proxies=proxies, verify=False)
if response.status_code == 200:
    print('Successfully')
    print(response.text)